<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Login Form</title>
  <link rel="stylesheet" href="css/style.css">
  <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
  <section class="container">
    <div class="login">
      <h1>Login to Web App</h1>
      <form method="post" action="index.html">
        <p><input id="summary1" type="text" name="login" value="" placeholder="Username or Email"></p>
        <p><input type="password" name="password" value="" placeholder="Password"></p>
        <p class="remember_me">
          <label>
            <input type="checkbox" name="remember_me" id="remember_me">
            Remember me on this computer
          </label>
        </p>
        <p class="submit"><input type="submit" name="commit" value="Login"></p>
      </form>
    </div>

    <div class="login-help">
      <p>Forgot your password? <a href="index.html">Click here to reset it</a>.</p>
    </div>
  </section>
</body>

<script type="text/javascript">

$(document).ready(function(){
	  $.ajax({
	          type : 'GET',
	          complete: function(){
	                //$('.loading-promo-boxes').hide();
	            },                            
	          dataType : 'json',
	          contentType : "application/json",
	          url : "http://localhost:8080/restful-hibernate/rest/hello",
	          success : function(data) {
	                        var data=data.TODOLIST;
	                        $("#summary1").val(data.summary);
	                        //var data = data;
	                        //$("#summary1").val(data[0].summary);
	          },
	          error : function(xhr, err) {
	                          console.log('Sample of error data:', err);
	                          console.log("readyState: " + xhr.readyState + "\nstatus: "
	                                          + xhr.status + "\nresponseText: "
	                                          + xhr.responseText);
	          }

  });
});

</script>

</html>
